package com.example.application.weather;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.application.setting.ForthFragment;
import com.example.application.news.SecondFragment;
import com.example.application.cities.ThirdFragment;

public class OrderPagerAdapter extends FragmentStateAdapter {
    public OrderPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if(position==0){
            return new FirstFragment();
        }else if(position==1){
            return new SecondFragment();
        }else if(position==2){
            return new ThirdFragment();
        }else{
            return new ForthFragment();
        }
    }

    @Override
    public int getItemCount() {
        return 4;
    }
}
